import React, { PureComponent } from 'react';
import { BarLoader } from 'react-spinners';
import styles from './index.less';

const exclude = ['/user/login', '/user/forget'];

export default class Preloader extends PureComponent {
  render() {
    const { computedMatch: { path } } = this.props;

    return (
      exclude.indexOf(path) === -1 ?
        <div className={styles.smooth_loader_wrapper}>
          <div className={styles.smooth_loader}>
            <div className={styles.loader}>
              <BarLoader
                height={6}
                width={240}
                color={'#1890ff'}
                loading={true}
              />
            </div>
          </div>
        </div> : null
    );
  }
}